package com.btl.service.ai.biz.facade;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.btl.service.ai.biz.service.IAiAgentService;
import com.btl.service.ai.biz.service.IChatHistoryService;
import com.btl.service.ai.support.rag.store.rdb.table.ChatHistory;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 智能体
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class AgentFacade {


    private final IAiAgentService iAiAgentService;

    private final IChatHistoryService iChatHistoryService;

    /**
     * 历史聊天记录
     *
     * @param chatMemoryId 文件
     * @return Long
     */
    public Page<ChatHistory> chatHistory(String chatMemoryId, Long current, Long size) {
        return iChatHistoryService.page(new Page<>(current, size),
                new LambdaQueryWrapper<ChatHistory>()
                .eq(ChatHistory::getId, chatMemoryId));

    }

}
